package com.wanmait.baohan.config;

import com.wanmait.baohan.handler.LoginHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    //拦截器配置类
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String[] excludes = {"/login","/error"};
        registry.addInterceptor(new LoginHandler()).addPathPatterns("/**").excludePathPatterns(excludes);
    }
}
